import { InputQuestion, QuestionBase, TimeQuestion, SelectQuestion, RadioQuestion, TextQuestion, CustomTableQuestion } from '@/components/public-template';
import { TextTable } from '@/components/public-template';
import { TableBase } from '@/components/public-template';
import { regExp } from '@/utils/regExp';

class HomeService {
  // 基础信息
  getQuestions() {
    const questions: QuestionBase<any>[] = [
      new InputQuestion({
        key: 'code',
        label: '模板编码',
        value: null
      }),
      new InputQuestion({
        key: 'name',
        label: '模板名称',
        value: null
      })
    ];
    return questions;
  }

  getTables() {
    const tables: TableBase<any>[] = [
      new TextTable({
        key: 'code',
        value: '模板编码'
      }),
      new TextTable({
        key: 'name',
        value: '模板名称'
      }),
      new TextTable({
        key: 'version',
        value: '模板版本号'
      }),
      new TextTable({
        key: 'remark',
        value: '备注'
      }),
      new TextTable({
        key: 'creatorName',
        value: '创建人'
      }),
      new TextTable({
        key: 'createdTime',
        value: '创建时间'
      }),
      new TextTable({
        key: 'modifierName',
        value: '修改人'
      }),
      new TextTable({
        key: 'modifiedTime',
        value: '修改时间'
      }),
      new TextTable({
        key: 'actions',
        value: '操作',
        type: 'slot',
        state: {
          slotName: 'download'
        }
        // handle: [
        //   {
        //     type: 'local',
        //     text: '预览',
        //     class: 'text-primary',
        //     state: {}
        //   },
        //   {
        //     type: 'local',
        //     text: '下载',
        //     class: 'text-primary',
        //     state: {},
        //     showKey: [{ key: 'status', value: 2 }]
        //   },
        //   {
        //     type: 'local',
        //     text: '下载',
        //     class: 'text-primary',
        //     state: {},
        //     showKey: [{ key: 'status', value: 4 }]
        //   }
        // ]
      })
    ];
    return tables;
  }
}

export default new HomeService();
